<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>发布资料</title>
        <link rel="shortcut icon" href="/public/img/logo.ico" type="image/x-icon" >
        <link rel="stylesheet" type="text/css" href="/public/css/fabuziliao/details.css"/>
        <script src="/public/js/jquery-1.11.3.js" type="text/javascript" charset="utf-8"></script>
        <link rel="stylesheet" type="text/css" href="/public/css/styles.css"/>
        <link rel="stylesheet" type="text/css" href="/public/css/header.css"/>
        <link rel="stylesheet" type="text/css" href="/public/js/TQEditor.2.3.8/TQEditor.css"/>
        <link rel="stylesheet" href="/public/css/jquery-ui.css">

    </head>
    <body>
        <div id="container">
            #{include '_navbar.html' /}


            <div id="center">
                <div class="left">
                    <form action="@{B.post}" method="POST"  enctype="multipart/form-data" ajax>
                        <div id="top">
                            <div class="btn">
                                <input type="button"  value="存为草稿" />
                                <input type="button"  value="预览" />
                                <input type="submit" id="fabu" value="发布" />
                            </div>
                        </div>
                        <table border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td class="bt">标题</td>
                                <td><input type="text" id="title" name="subject" value="" class="c" /></td>
                                <td class="bt">作者</td>
                                <td><input type="text" id="author" name="author" value="" class="d"/></td>
                            </tr>
                            <tr>
                                <td class="bt">分类</td>
                                <td><input type="text" id="search" name="tags" placeholder="输入问题分类，让更多专业的人发现。" value="" class="c"/></td>
                                <td class="bt">&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="bt">主图</td>
                                <td colspan="3"><input type="file" name="files"  size="45" class="img"/></td>
                            </tr>

                            <tr>
                                <td class="bt">正文</td>
                                <td colspan="3"><textarea name="content"  id="zhengwen" style="width: 100%;"></textarea></td>

                            </tr>

                        </table>
                    </form>

                </div>
                <div class="right">
                    <div class="img">
                        <img src="/public/img/fabuziliao/zhanshi.png"/>
                    </div>
                    <ul class="out">
                        <li>
                            <ul class="in">
                                <li><img src="/public/img/dongTai/caogao.png"/></li>
                                <li class="text">我的草稿</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                        <li>
                            <ul class="in">
                                <li><img src="/public/img/ziLiao/u13.png"/></li>
                                <li class="text">我的收藏</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                        <li>
                            <ul class="in">
                                <li><img src="/public/img/dongTai/guanzhu.png"/></li>
                                <li class="text">我的关注</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                        <li>
                            <ul class="in">
                                <li><img src="/public/img/dongTai/fabu.png"/></li>
                                <li class="text">我发布的帖子</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                        <li>
                            <ul class="in">
                                <li><img src="/public/img/dongTai/pinglun.png"/></li>
                                <li class="text">我评论的帖子</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                        <li>
                            <ul class="in">
                                <li><img src="/public/img/fabuziliao/zl.png"/></li>
                                <li class="text">我发布的资料</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                        <li>
                            <ul class="in">
                                <li><img src="/public/img/fabuziliao/xiug.png"/></li>
                                <li class="text">我评论的资料</li>
                                <li class="count">4</li>
                            </ul>
                        </li>

                    </ul>
                </div>
            </div>
        </div>

        <script src="/public/js/TQEditor.2.3.8/TQEditor.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/js/jquery-ui.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/js/jquery.form.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/js/xjp.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript">
            $.widget("custom.catcomplete", $.ui.autocomplete, {
                _renderMenu: function (ul, items) {
                    var that = this,
                            currentCategory = "";
                    $.each(items, function (index, item) {
                        if (item.category != currentCategory) {
                            ul.append("<li class='ui-autocomplete-category'>" + item.category + "</li>");
                            currentCategory = item.category;
                        }
                        that._renderItemData(ul, item);
                    });
                }
            });
        </script>
        <script type="text/javascript">
            $(function () {
                new TQEditor("zhengwen", {toolbar: 'mini', imageUploadUrl: '../js/TQEditor.2.3.8/upload.inc.php', directInsertUploadImage: true, linkUploadUrl: './upload.php', resize: '0'});
            });
        </script>
        <script type="text/javascript">
            $(function () {
                $(".userinfo").hover(function () {
                    $(".info").slideDown();
                }, function () {
                    $(".info").slideUp();
                });

                //及时搜索
                var countries = [
                    {value: '室内设计', data: '', category: '分类'},
                    {value: '室内装修', data: '室内', category: '分类'},
                    {value: '室内环保', data: '室内', category: '分类'},
                    {value: '室内设计', data: '室内', category: '分类'},
                    {value: '室内设计', data: '室内', category: '分类'},
                    {value: '某宾馆室内设计', data: '室内', category: '话题'},
                    {value: '某大厦室内设计', data: '室内', category: '话题'},
                    {value: '某宾馆室内设计', data: '室内', category: '资料'},
                    {value: '某大厦室内设计', data: '室内', category: '资料'},
                    {value: '某宾馆室内设计', data: '室内', category: '资料'},
                    {value: '某大厦室内设计', data: '室内', category: '资料'},
                    {value: '小龙女      室内设计师', data: '室内', category: '用户'},
                    {value: '更多室内相关资料...', data: '室内', category: '更多'},
                    // ...
                    {value: 'Zimbabwe', data: 'ZZ'}
                ];


                $('#autocomplete').catcomplete({
                    source: countries,
                    delay: 0,
                    select: function (event, ui) {
                        var type = ui.item.category
                        if (type.trim() == "分类") {
                            window.location.href = "souSuojieguo.html"
                        }
                        if (type.trim() == "话题") {
                            window.location.href = "souSuojieguo.html?name=huati"
                        }
                        if (type.trim() == "资料") {
                            window.location.href = "souSuojieguo.html?name=ziliao"
                        }
                        if (type.trim() == "用户") {
                            window.location.href = "souSuojieguo.html?name=yonghu"
                        }
                    }
                })


            })
        </script>
        <script type="text/javascript">
                    (function ($) {
                        $.getUrlParam = function (name) {
                            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                            var r = window.location.search.substr(1).match(reg);
                            if (r != null)
                                return decodeURI(r[2]);
                            return null;
                        }
                    })(jQuery);
            var t = $.getUrlParam("title");
            var a = $.getUrlParam("author")
            var c = $.getUrlParam("content");
            if (t.trim() != "") {
                $("#title").val(t);
            }
            if (a.trim() != "") {
                $("#author").val(a);
            }
            if (c.trim() != "") {
                $("#zhengwen").val(c);
            }
        </script>





    </body>
</html>
